package com.hm.service.api;

import com.alibaba.fastjson2.JSON;
import com.hm.service.api.user.UserService;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/USER", produces = {"application/json;charset=UTF-8"})
public class YDCG_000_000_000 {
    private static final Logger logger = LoggerFactory.getLogger(YDCG_000_000_000.class);


    @Qualifier("ServerConfig")
    private final DubboBootstrap bootStrap;

    public YDCG_000_000_000(DubboBootstrap bootStrap) {
        this.bootStrap = bootStrap;
    }

    @GetMapping(value = "/000_000_000")
    public String doPost(HttpServletRequest request) {
        try {
            logger.info("请求进来了");
            UserService userService = bootStrap.getCache().get(UserService.class);
            userService.addUser();
            return "添加用户成功";
        } catch (Exception e) {
            logger.error(e.getMessage());
            return e.getMessage();
        }
    }
}


